package StudyCode.summary.mycollection;

import java.util.Iterator;
import java.util.TreeSet;

/**
 * 版权所有 科技与人文(www.tah1986.com)
 */
public class IterateThroughElementsOfTreeSet {
	public static void main(String[] args) {
		TreeSet tSet = new TreeSet();
		tSet.add(new Integer("1"));
		tSet.add(new Integer("2"));
		tSet.add(new Integer("3"));

		Iterator itr = tSet.iterator();

		System.out.println("TreeSet 元素 : ");
		while (itr.hasNext())
			System.out.println(itr.next());
	}
}
